home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / Processes.a < prev    next >
Encoding:
Text File  |  1997-08-12  |  7.5 KB  |  261 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Processes.a
  3. ;
  4. ;    Contains:    Process Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.0.1
  8. ;
  9. ;    Copyright:    © 1989-1997 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__PROCESSES__') = 'UNDEFINED' THEN
  19. __PROCESSES__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.     IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
  25.     include 'Events.a'
  26.     ENDIF
  27.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  28.     include 'Files.a'
  29.     ENDIF
  30.  
  31. ;  type for unique process identifier 
  32. ProcessSerialNumber        RECORD 0
  33. highLongOfPSN             ds.l    1                ; offset: $0 (0)
  34. lowLongOfPSN             ds.l    1                ; offset: $4 (4)
  35. sizeof                     EQU *                    ; size:   $8 (8)
  36.                         ENDR
  37. ; typedef struct ProcessSerialNumber *    ProcessSerialNumberPtr
  38.  
  39.  
  40.                                                             ; Process identifier - Various reserved process serial numbers 
  41. kNoProcess                        EQU        0
  42. kSystemProcess                    EQU        1
  43. kCurrentProcess                    EQU        2
  44. ;  Definition of the parameter block passed to _Launch 
  45. ;  Typedef and flags for launchControlFlags field
  46. ; typedef unsigned short                 LaunchFlags
  47.  
  48.  
  49. launchContinue                    EQU        $4000
  50. launchNoFileFlags                EQU        $0800
  51. launchUseMinimum                EQU        $0400
  52. launchDontSwitch                EQU        $0200
  53. launchAllow24Bit                EQU        $0100
  54. launchInhibitDaemon                EQU        $0080
  55. ;  Format for first AppleEvent to pass to new process.  The size of the overall
  56. ;  buffer variable: the message body immediately follows the messageLength 
  57. AppParameters            RECORD 0
  58. theMsgEvent                 ds        EventRecord        ; offset: $0 (0)
  59. eventRefCon                 ds.l    1                ; offset: $10 (16)
  60. messageLength             ds.l    1                ; offset: $14 (20)
  61. sizeof                     EQU *                    ; size:   $18 (24)
  62.                         ENDR
  63. ; typedef struct AppParameters *        AppParametersPtr
  64.  
  65. ;  Parameter block to _Launch 
  66. LaunchParamBlockRec        RECORD 0
  67. reserved1                 ds.l    1                ; offset: $0 (0)
  68. reserved2                 ds.w    1                ; offset: $4 (4)
  69. launchBlockID             ds.w    1                ; offset: $6 (6)
  70. launchEPBLength             ds.l    1                ; offset: $8 (8)
  71. launchFileFlags             ds.w    1                ; offset: $C (12)
  72. launchControlFlags         ds.w    1                ; offset: $E (14)
  73. launchAppSpec             ds.l    1                ; offset: $10 (16)
  74. launchProcessSN             ds        ProcessSerialNumber ; offset: $14 (20)
  75. launchPreferredSize         ds.l    1                ; offset: $1C (28)
  76. launchMinimumSize         ds.l    1                ; offset: $20 (32)
  77. launchAvailableSize         ds.l    1                ; offset: $24 (36)
  78. launchAppParameters         ds.l    1                ; offset: $28 (40)
  79. sizeof                     EQU *                    ; size:   $2C (44)
  80.                         ENDR
  81. ; typedef struct LaunchParamBlockRec *    LaunchPBPtr
  82.  
  83. ;  Set launchBlockID to extendedBlock to specify that extensions exist.
  84. ; Set launchEPBLength to extendedBlockLen for compatibility.
  85.  
  86. extendedBlock                    EQU        $4C43                ; 'LC' 
  87. extendedBlockLen                EQU        32
  88.  
  89.                                                             ; Definition of the information block returned by GetProcessInformation 
  90. modeLaunchDontSwitch            EQU        $00040000
  91. modeDeskAccessory                EQU        $00020000
  92. modeMultiLaunch                    EQU        $00010000
  93. modeNeedSuspendResume            EQU        $00004000
  94. modeCanBackground                EQU        $00001000
  95. modeDoesActivateOnFGSwitch        EQU        $00000800
  96. modeOnlyBackground                EQU        $00000400
  97. modeGetFrontClicks                EQU        $00000200
  98. modeGetAppDiedMsg                EQU        $00000100
  99. mode32BitCompatible                EQU        $00000080
  100. modeHighLevelEventAware            EQU        $00000040
  101. modeLocalAndRemoteHLEvents        EQU        $00000020
  102. modeStationeryAware                EQU        $00000010
  103. modeUseTextEditServices            EQU        $00000008
  104. modeDisplayManagerAware            EQU        $00000004
  105. ;  Record returned by GetProcessInformation 
  106. ProcessInfoRec            RECORD 0
  107. processInfoLength         ds.l    1                ; offset: $0 (0)
  108. processName                 ds.l    1                ; offset: $4 (4)
  109. processNumber             ds        ProcessSerialNumber ; offset: $8 (8)
  110. processType                 ds.l    1                ; offset: $10 (16)
  111. processSignature         ds.l    1                ; offset: $14 (20)
  112. processMode                 ds.l    1                ; offset: $18 (24)
  113. processLocation             ds.l    1                ; offset: $1C (28)
  114. processSize                 ds.l    1                ; offset: $20 (32)
  115. processFreeMem             ds.l    1                ; offset: $24 (36)
  116. processLauncher             ds        ProcessSerialNumber ; offset: $28 (40)
  117. processLaunchDate         ds.l    1                ; offset: $30 (48)
  118. processActiveTime         ds.l    1                ; offset: $34 (52)
  119. processAppSpec             ds.l    1                ; offset: $38 (56)
  120. sizeof                     EQU *                    ; size:   $3C (60)
  121.                         ENDR
  122. ; typedef struct ProcessInfoRec *        ProcessInfoRecPtr
  123.  
  124. ;
  125. ; pascal OSErr LaunchApplication(LaunchPBPtr LaunchParams)
  126. ;
  127.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  128.         ; parameters:
  129.         ;    LaunchParams    => A0
  130.         ; returns:
  131.         ;    OSErr           <= D0
  132.         _LaunchApplication:    OPWORD    $A9F2
  133.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  134.         IMPORT_CFM_FUNCTION LaunchApplication
  135.     ENDIF
  136.  
  137. ;
  138. ; pascal OSErr LaunchDeskAccessory(const FSSpec *pFileSpec, ConstStr255Param pDAName)
  139. ;
  140.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  141.         Macro
  142.         _LaunchDeskAccessory
  143.             move.w              #$0036,-(sp)
  144.             dc.w                $A88F
  145.         EndM
  146.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  147.         IMPORT_CFM_FUNCTION LaunchDeskAccessory
  148.     ENDIF
  149.  
  150. ;
  151. ; pascal OSErr GetCurrentProcess(ProcessSerialNumber *PSN)
  152. ;
  153.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  154.         Macro
  155.         _GetCurrentProcess
  156.             move.w              #$0037,-(sp)
  157.             dc.w                $A88F
  158.         EndM
  159.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  160.         IMPORT_CFM_FUNCTION GetCurrentProcess
  161.     ENDIF
  162.  
  163. ;
  164. ; pascal OSErr GetFrontProcess(ProcessSerialNumber *PSN)
  165. ;
  166.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  167.         Macro
  168.         _GetFrontProcess
  169.             moveq               #-1,D0
  170.             move.l              D0,-(sp)
  171.             move.w              #$0039,-(sp)
  172.             dc.w                $A88F
  173.         EndM
  174.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  175.         IMPORT_CFM_FUNCTION GetFrontProcess
  176.     ENDIF
  177.  
  178. ;
  179. ; pascal OSErr GetNextProcess(ProcessSerialNumber *PSN)
  180. ;
  181.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  182.         Macro
  183.         _GetNextProcess
  184.             move.w              #$0038,-(sp)
  185.             dc.w                $A88F
  186.         EndM
  187.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  188.         IMPORT_CFM_FUNCTION GetNextProcess
  189.     ENDIF
  190.  
  191. ;
  192. ; pascal OSErr GetProcessInformation(const ProcessSerialNumber *PSN, ProcessInfoRec *info)
  193. ;
  194.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  195.         Macro
  196.         _GetProcessInformation
  197.             move.w              #$003A,-(sp)
  198.             dc.w                $A88F
  199.         EndM
  200.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  201.         IMPORT_CFM_FUNCTION GetProcessInformation
  202.     ENDIF
  203.  
  204. ;
  205. ; pascal OSErr SetFrontProcess(const ProcessSerialNumber *PSN)
  206. ;
  207.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  208.         Macro
  209.         _SetFrontProcess
  210.             move.w              #$003B,-(sp)
  211.             dc.w                $A88F
  212.         EndM
  213.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  214.         IMPORT_CFM_FUNCTION SetFrontProcess
  215.     ENDIF
  216.  
  217. ;
  218. ; pascal OSErr WakeUpProcess(const ProcessSerialNumber *PSN)
  219. ;
  220.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  221.         Macro
  222.         _WakeUpProcess
  223.             move.w              #$003C,-(sp)
  224.             dc.w                $A88F
  225.         EndM
  226.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  227.         IMPORT_CFM_FUNCTION WakeUpProcess
  228.     ENDIF
  229.  
  230. ;
  231. ; pascal OSErr SameProcess(const ProcessSerialNumber *PSN1, const ProcessSerialNumber *PSN2, Boolean *result)
  232. ;
  233.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  234.         Macro
  235.         _SameProcess
  236.             move.w              #$003D,-(sp)
  237.             dc.w                $A88F
  238.         EndM
  239.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  240.         IMPORT_CFM_FUNCTION SameProcess
  241.     ENDIF
  242.  
  243.     IF ¬ OLDROUTINELOCATIONS THEN
  244. ;    ExitToShell was previously in SegLoad.h
  245. ;
  246.  
  247. ;
  248. ; pascal void ExitToShell(void )
  249. ;
  250.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  251.         _ExitToShell:    OPWORD    $A9F4
  252.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  253.         IMPORT_CFM_FUNCTION ExitToShell
  254.     ENDIF
  255.  
  256.     ENDIF
  257.  
  258.     ENDIF ; __PROCESSES__ 
  259.  
  260.